Delete autoClosingPairs from LanguageConfiguration to appease proposed API#2624
Delete autoClosingPairs from LanguageConfiguration to appease proposed API#2624robertbrignull merged 1 commit intomainfrom
Conversation
| decreaseIndentPattern: /^((?!.*?\/\*).*\*\/)?\s*[\}\]].*$/, | ||
| increaseIndentPattern: /^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/, | ||
| }; | ||
| delete langConfig.autoClosingPairs; |
There was a problem hiding this comment.
It would be unfortunate if we have to lose this functionality in regular vscode as well.
According to copilot, this snippet should let us determine what kind of vscode we are running in. Maybe we can use this to conditionally delete the autoClosingPairs.
import * as vscode from 'vscode';
if (vscode.env.appName === 'Visual Studio Code') {
console.log('Extension is running in Visual Studio Code');
} else if (vscode.env.appName === 'Visual Studio Code - Insiders') {
console.log('Extension is running in Visual Studio Code Insiders');
} else {
console.log('Extension is running in an unknown application');
}Though at some point, this needs to be reimplemented using the new API.
There was a problem hiding this comment.
Oh...I missed the fact that we're still getting the auto-close behaviour. Since this file is only used for the onEnterRules.
There was a problem hiding this comment.
Yeah the functionality still works, (at least it does when I test it), because autoClosingPairs is still in the json file.
Maybe we're skirting the rules by keeping autoClosingPairs in the json file, since it means we're using a proposed API feature but in a way where they don't catch it and stop us. Or maybe the json file API is genuinely a different API and that one isn't changing, so it's all fine. That would make sense since it would mean that this proposed API change is bringing the two APIs closer together in terms of features. I haven't interacted with this area before and I don't know enough to say either way.
aeisenberg
left a comment
There was a problem hiding this comment.
Probably fine to go in as-is.
|
Confirmed again that this starts correctly and the auto-closing pairs functionality works on both normal and insiders versions of VS Code. |
This allow the extension to start when using VS Code Insiders version
1.81.0-insider. We're running afoul of the new proposed API for autoClosingPairs.Once the proposed API has been merged and is supported by all VS Code versions we aim to support, we can remove this line and pass in
autoClosingPairsin theLanguageConfigurationobject.I've tested it and we do still get
autoClosingPairsbehaviour because we're still passing it in language-configuration.json. This seems to still work and it accepts the value and provides the desired behaviour.Checklist
ready-for-doc-reviewlabel there.